<template>
    <div class="email-content">
        <Input v-model="content" type="textarea" :rows="9"></Input>
    </div>
</template>

<script>

export default {
    name: 'EmailContent',
    props: {
        isBug: {
            type: Boolean,
            default: false
        },
        value: {
            type: String,
            default: ''
        },
        productName: {
            type: String,
            default: '-'
        },
        vulnerabilityName: {
            type: String,
            default: '-'
        },
        module: {
            type: String,
            default: '-'
        },
        url: {
            type: String,
            default: '-'
        },
        level: {
            type: String,
            default: '-'
        },
        score: {
            type: [String, Number],
            default: '-'
        },
        description: {
            type: String,
            default: '-'
        },
        sulotion: {
            type: String,
            default: '-'
        },
        publicUrl: {
            type: String,
            default: '-'
        },
    },
    watch: {
        content(val) {
            this.$emit('input', val)
        }
    },
    data() {
        return {
            content: this.value,
        }
    },
    methods: {
        setContent() {
            this.content = `产品名称:${this.productName || '-'}
漏洞名称:${this.vulnerabilityName || '-'}
所在模块:${this.module || '-'},
地址:${this.publicUrl || '-'},
严重级别:${this.isBug ? this.$CodeEscape.bugLevelEscape(this.level).text : this.$CodeEscape.vulnerabilityLevelEscape(this.level).text},
评分:${(this.score || this.score === 0) ? this.score : '-'},
漏洞描述:${this.description || '-'},
解决方案:${this.sulotion || '-'},
参考url:${this.url || '-'}`
        }
    },
}
</script>

<style  scoped>
.email-content {
    width: 100%;
}
</style>
